package com.zzl.conf;

import org.beetl.core.GroupTemplate;
import org.beetl.core.Template;
import org.beetl.ext.web.WebRenderExt;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author: zhangzeli
 * @date 13:08 2018/5/11
 * <P></P>
 */
public class GlobalExt implements WebRenderExt {
    @Override
    public void modify(Template template, GroupTemplate groupTemplate, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
        String contextPath = httpServletRequest.getContextPath();
        template.binding("ctxPath",contextPath);
    }
}
